function mpc = t_case24_ieee_rts_3p
%T_CASE24_IEEE_RTS_3P

%% MATPOWER Case Format : Version 2
mpc.version = '2';

%%-----  Power Flow Data  -----%%
%% system MVA base
mpc.baseMVA = 100;

%% bus data
%	bus_i	type	Pd	Qd	Gs	Bs	area	Vm	Va	baseKV	zone	Vmax	Vmin
mpc.bus = [];

%% generator data
%	bus	Pg	Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin	Pc1	Pc2	Qc1min	Qc1max	Qc2min	Qc2max	ramp_agc	ramp_10	ramp_30	ramp_q	apf
mpc.gen = [];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status	angmin	angmax
mpc.branch = [];

%%-----  3 Phase Model Data  -----%%
%% system data
mpc.freq = 60;      %% frequency, Hz
mpc.basekVA = 100000; %% system kVA base

%% 3-phase bus data
%	busid	type	basekV	Vm1	Vm2	Vm3	Va1	Va2	Va3
mpc.bus3p = [
	1	2	138	1	1	1	0	-120	120;
	2	2	138	1	1	1	0	-120	120;
	3	1	138	1	1	1	0	-120	120;
	4	1	138	1	1	1	0	-120	120;
	5	1	138	1	1	1	0	-120	120;
	6	1	138	1	1	1	0	-120	120;
	7	2	138	1	1	1	0	-120	120;
	8	1	138	1	1	1	0	-120	120;
	9	1	138	1	1	1	0	-120	120;
	10	1	138	1	1	1	0	-120	120;
	11	1	230	1	1	1	0	-120	120;
	12	1	230	1	1	1	0	-120	120;
	13	3	230	1	1	1	0	-120	120;
	14	2	230	1	1	1	0	-120	120;
	15	2	230	1	1	1	0	-120	120;
	16	2	230	1	1	1	0	-120	120;
	17	1	230	1	1	1	0	-120	120;
	18	2	230	1	1	1	0	-120	120;
	19	1	230	1	1	1	0	-120	120;
	20	1	230	1	1	1	0	-120	120;
	21	2	230	1	1	1	0	-120	120;
	22	2	230	1	1	1	0	-120	120;
	23	2	230	1	1	1	0	-120	120;
	24	1	230	1	1	1	0	-120	120;
];

%% buslink data
%	linkid	busid	bus3pid	status
mpc.buslink = [];

%% 3-phase line data
%	brid	fbus	tbus	status	lcid	len
mpc.line3p = [
	1	1	2	1	1	5280/5280;
	2	1	3	1	2	5280/5280;
	3	1	5	1	3	5280/5280;
	4	2	4	1	4	5280/5280;
	5	2	6	1	5	5280/5280;
	6	3	9	1	6	5280/5280;
	7	4	9	1	7	5280/5280;
	8	5	10	1	8	5280/5280;
	9	6	10	1	9	5280/5280;
	10	7	8	1	10	5280/5280;
	11	8	9	1	11	5280/5280;
	12	8	10	1	12	5280/5280;
	13	11	13	1	13	5280/5280;
	14	11	14	1	14	5280/5280;
	15	12	13	1	15	5280/5280;
	16	12	23	1	16	5280/5280;
	17	13	23	1	17	5280/5280;
	18	14	16	1	18	5280/5280;
	19	15	16	1	19	5280/5280;
	20	15	21	1	20	5280/5280;
	21	15	21	1	21	5280/5280;
	22	15	24	1	22	5280/5280;
	23	16	17	1	23	5280/5280;
	24	16	19	1	24	5280/5280;
	25	17	18	1	25	5280/5280;
	26	17	22	1	26	5280/5280;
	27	18	21	1	27	5280/5280;
	28	18	21	1	28	5280/5280;
	29	19	20	1	29	5280/5280;
	30	19	20	1	30	5280/5280;
	31	20	23	1	31	5280/5280;
	32	20	23	1	32	5280/5280;
	33	21	22	1	33	5280/5280;
];

%% 3-phase transformer data
%	xfid	fbus	tbus	status	R	X	basekVA	basekV	ratio
mpc.xfmr3p = [
	1	3	24	1	0.0023	0.0839	33333.3333	79.6743371	1.03;
	2	9	11	1	0.0023	0.0839	33333.3333	79.6743371	1.03;
	3	9	12	1	0.0023	0.0839	33333.3333	79.6743371	1.03;
	4	10	11	1	0.0023	0.0839	33333.3333	79.6743371	1.02;
	5	10	12	1	0.0023	0.0839	33333.3333	79.6743371	1.02;
];

%% 3-phase shunt data
%	shid	shbus	status	gs1	gs2	gs3	bs1	bs2	bs3
mpc.shunt3p = [
	1	6	1	0	0	0	-33333.3333	-33333.3333	-33333.3333;
];

%% 3-phase load data
%	ldid	ldbus	status	Pd1	Pd2	Pd3	ldpf1	ldpf2	ldpf3
mpc.load3p = [
	1	1	1	36000	36000	36000	0.979876549	0.979876549	0.979876549;
	2	2	1	32333.3333	32333.3333	32333.3333	0.979398348	0.979398348	0.979398348;
	3	3	1	60000	60000	60000	0.979520219	0.979520219	0.979520219;
	4	4	1	24666.6667	24666.6667	24666.6667	0.980067977	0.980067977	0.980067977;
	5	5	1	23666.6667	23666.6667	23666.6667	0.981108553	0.981108553	0.981108553;
	6	6	1	45333.3333	45333.3333	45333.3333	0.979457043	0.979457043	0.979457043;
	7	7	1	41666.6667	41666.6667	41666.6667	0.980580676	0.980580676	0.980580676;
	8	8	1	57000	57000	57000	0.97968936	0.97968936	0.97968936;
	9	9	1	58333.3333	58333.3333	58333.3333	0.979489545	0.979489545	0.979489545;
	10	10	1	65000	65000	65000	0.979602701	0.979602701	0.979602701;
	11	13	1	88333.3333	88333.3333	88333.3333	0.979863154	0.979863154	0.979863154;
	12	14	1	64666.6667	64666.6667	64666.6667	0.980385827	0.980385827	0.980385827;
	13	15	1	105666.667	105666.667	105666.667	0.980222262	0.980222262	0.980222262;
	14	16	1	33333.3333	33333.3333	33333.3333	0.980580676	0.980580676	0.980580676;
	15	18	1	111000	111000	111000	0.979780523	0.979780523	0.979780523;
	16	19	1	60333.3333	60333.3333	60333.3333	0.979739078	0.979739078	0.979739078;
	17	20	1	42666.6667	42666.6667	42666.6667	0.97998732	0.97998732	0.97998732;
];

%% 3-phase generator data
%	genid	gbus	status	Vg1	Vg2	Vg3	Pg1	Pg2	Pg3	Qg1	Qg2	Qg3
mpc.gen3p = [
	1	1	1	1.035	1.035	1.035	3333.33333	3333.33333	3333.33333	0	0	0;
	2	1	1	1.035	1.035	1.035	3333.33333	3333.33333	3333.33333	0	0	0;
	3	1	1	1.035	1.035	1.035	25333.3333	25333.3333	25333.3333	0	0	0;
	4	1	1	1.035	1.035	1.035	25333.3333	25333.3333	25333.3333	0	0	0;
	5	2	1	1.035	1.035	1.035	3333.33333	3333.33333	3333.33333	0	0	0;
	6	2	1	1.035	1.035	1.035	3333.33333	3333.33333	3333.33333	0	0	0;
	7	2	1	1.035	1.035	1.035	25333.3333	25333.3333	25333.3333	0	0	0;
	8	2	1	1.035	1.035	1.035	25333.3333	25333.3333	25333.3333	0	0	0;
	9	7	1	1.025	1.025	1.025	26666.6667	26666.6667	26666.6667	0	0	0;
	10	7	1	1.025	1.025	1.025	26666.6667	26666.6667	26666.6667	0	0	0;
	11	7	1	1.025	1.025	1.025	26666.6667	26666.6667	26666.6667	0	0	0;
	12	13	1	1.02	1.02	1.02	31700	31700	31700	0	0	0;
	13	13	1	1.02	1.02	1.02	31700	31700	31700	0	0	0;
	14	13	1	1.02	1.02	1.02	31700	31700	31700	0	0	0;
	15	14	1	0.98	0.98	0.98	0	0	0	0	0	0;
	16	15	1	1.014	1.014	1.014	4000	4000	4000	0	0	0;
	17	15	1	1.014	1.014	1.014	4000	4000	4000	0	0	0;
	18	15	1	1.014	1.014	1.014	4000	4000	4000	0	0	0;
	19	15	1	1.014	1.014	1.014	4000	4000	4000	0	0	0;
	20	15	1	1.014	1.014	1.014	4000	4000	4000	0	0	0;
	21	15	1	1.014	1.014	1.014	51666.6667	51666.6667	51666.6667	0	0	0;
	22	16	1	1.017	1.017	1.017	51666.6667	51666.6667	51666.6667	0	0	0;
	23	18	1	1.05	1.05	1.05	133333.333	133333.333	133333.333	0	0	0;
	24	21	1	1.05	1.05	1.05	133333.333	133333.333	133333.333	0	0	0;
	25	22	1	1.05	1.05	1.05	16666.6667	16666.6667	16666.6667	0	0	0;
	26	22	1	1.05	1.05	1.05	16666.6667	16666.6667	16666.6667	0	0	0;
	27	22	1	1.05	1.05	1.05	16666.6667	16666.6667	16666.6667	0	0	0;
	28	22	1	1.05	1.05	1.05	16666.6667	16666.6667	16666.6667	0	0	0;
	29	22	1	1.05	1.05	1.05	16666.6667	16666.6667	16666.6667	0	0	0;
	30	22	1	1.05	1.05	1.05	16666.6667	16666.6667	16666.6667	0	0	0;
	31	23	1	1.05	1.05	1.05	51666.6667	51666.6667	51666.6667	0	0	0;
	32	23	1	1.05	1.05	1.05	51666.6667	51666.6667	51666.6667	0	0	0;
	33	23	1	1.05	1.05	1.05	116666.667	116666.667	116666.667	0	0	0;
];

%% line construction data
%	lcid	R11	R21	R31	R22	R32	R33	X11	X21	X31	X22	X32	X33	C11	C21	C31	C22	C32	C33
mpc.lc = [
	1	0.495144	0	0	0.495144	0	0.495144	2.647116	0	0	2.647116	0	2.647116	6422.5254	0	0	6422.5254	0	6422.5254;
	2	10.398024	0	0	10.398024	0	10.398024	40.220928	0	0	40.220928	0	40.220928	796.721867	0	0	796.721867	0	796.721867;
	3	4.151592	0	0	4.151592	0	4.151592	16.09218	0	0	16.09218	0	16.09218	318.967321	0	0	318.967321	0	318.967321;
	4	6.246432	0	0	6.246432	0	6.246432	24.128748	0	0	24.128748	0	24.128748	477.754546	0	0	477.754546	0	477.754546;
	5	9.464868	0	0	9.464868	0	9.464868	36.56448	0	0	36.56448	0	36.56448	724.292607	0	0	724.292607	0	724.292607;
	6	5.865552	0	0	5.865552	0	5.865552	22.66236	0	0	22.66236	0	22.66236	448.504268	0	0	448.504268	0	448.504268;
	7	5.103792	0	0	5.103792	0	5.103792	19.748628	0	0	19.748628	0	19.748628	391.396582	0	0	391.396582	0	391.396582;
	8	4.342032	0	0	4.342032	0	4.342032	16.815852	0	0	16.815852	0	16.815852	332.896025	0	0	332.896025	0	332.896025;
	9	2.647116	0	0	2.647116	0	2.647116	11.52162	0	0	11.52162	0	11.52162	34250.6831	0	0	34250.6831	0	34250.6831;
	10	3.027996	0	0	3.027996	0	3.027996	11.693016	0	0	11.693016	0	11.693016	231.216486	0	0	231.216486	0	231.216486;
	11	8.131788	0	0	8.131788	0	8.131788	31.441644	0	0	31.441644	0	31.441644	622.613068	0	0	622.613068	0	622.613068;
	12	8.131788	0	0	8.131788	0	8.131788	31.441644	0	0	31.441644	0	31.441644	622.613068	0	0	622.613068	0	622.613068;
	13	3.2269	0	0	3.2269	0	3.2269	25.1804	0	0	25.1804	0	25.1804	500.93191	0	0	500.93191	0	500.93191;
	14	2.8566	0	0	2.8566	0	2.8566	22.1122	0	0	22.1122	0	22.1122	440.759909	0	0	440.759909	0	440.759909;
	15	3.2269	0	0	3.2269	0	3.2269	25.1804	0	0	25.1804	0	25.1804	500.93191	0	0	500.93191	0	500.93191;
	16	6.5596	0	0	6.5596	0	6.5596	51.1014	0	0	51.1014	0	51.1014	1017.90969	0	0	1017.90969	0	1017.90969;
	17	5.8719	0	0	5.8719	0	5.8719	45.7585	0	0	45.7585	0	45.7585	911.605818	0	0	911.605818	0	911.605818;
	18	2.645	0	0	2.645	0	2.645	20.5781	0	0	20.5781	0	20.5781	410.172475	0	0	410.172475	0	410.172475;
	19	1.1638	0	0	1.1638	0	1.1638	9.1517	0	0	9.1517	0	9.1517	182.521737	0	0	182.521737	0	182.521737;
	20	3.3327	0	0	3.3327	0	3.3327	25.921	0	0	25.921	0	25.921	516.476343	0	0	516.476343	0	516.476343;
	21	3.3327	0	0	3.3327	0	3.3327	25.921	0	0	25.921	0	25.921	516.476343	0	0	516.476343	0	516.476343;
	22	3.5443	0	0	3.5443	0	3.5443	27.4551	0	0	27.4551	0	27.4551	547.063777	0	0	547.063777	0	547.063777;
	23	1.7457	0	0	1.7457	0	1.7457	13.7011	0	0	13.7011	0	13.7011	273.281172	0	0	273.281172	0	273.281172;
	24	1.587	0	0	1.587	0	1.587	12.2199	0	0	12.2199	0	12.2199	243.195171	0	0	243.195171	0	243.195171;
	25	0.9522	0	0	0.9522	0	0.9522	7.6176	0	0	7.6176	0	7.6176	151.934303	0	0	151.934303	0	151.934303;
	26	7.1415	0	0	7.1415	0	7.1415	55.7037	0	0	55.7037	0	55.7037	1109.17055	0	0	1109.17055	0	1109.17055;
	27	1.7457	0	0	1.7457	0	1.7457	13.7011	0	0	13.7011	0	13.7011	273.281172	0	0	273.281172	0	273.281172;
	28	1.7457	0	0	1.7457	0	1.7457	13.7011	0	0	13.7011	0	13.7011	273.281172	0	0	273.281172	0	273.281172;
	29	2.6979	0	0	2.6979	0	2.6979	20.9484	0	0	20.9484	0	20.9484	417.693975	0	0	417.693975	0	417.693975;
	30	2.6979	0	0	2.6979	0	2.6979	20.9484	0	0	20.9484	0	20.9484	417.693975	0	0	417.693975	0	417.693975;
	31	1.4812	0	0	1.4812	0	1.4812	11.4264	0	0	11.4264	0	11.4264	228.152171	0	0	228.152171	0	228.152171;
	32	1.4812	0	0	1.4812	0	1.4812	11.4264	0	0	11.4264	0	11.4264	228.152171	0	0	228.152171	0	228.152171;
	33	4.6023	0	0	4.6023	0	4.6023	35.8662	0	0	35.8662	0	35.8662	714.041081	0	0	714.041081	0	714.041081;
];
